local storyboard = require( "storyboard" )

local scene = storyboard.newScene()

local centerX = display.contentCenterX
local centerY = display.contentCenterY

local bg
local label

local menuView

local function onTouch( event )
	transition.to(menuView, 
    {
    	time = 500, y = -menuView.height, onComplete = 
    	function()
    		display.remove(menuView)
			storyboard.gotoScene( "game" )
    	end
    })
end

function scene:createScene( event )
	menuView = self.view

	bg = display.newImage( menuView, "bg.png" )
	bg:translate( centerX, centerY )

	label = display.newText( menuView, "Touch screen to plays", centerX, centerY - 120, "Arial", 15 )
	label:setTextColor( 255 )

	menuView:addEventListener( "tap", onTouch )
end

function scene:destroyScene( event )
	label:removeEventListener( "tap", onTouch )
end	

scene:addEventListener( "createScene", scene )
scene:addEventListener( "destroyScene", scene )

return scene